/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package practica.pkg1.mercurial;
import java.io.*;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import java.lang.System;

/**
 *
 * @author Administrador
 */
public class Purchase extends javax.swing.JFrame {
     private int[] info=new int[5];
     private Object[][] information;
     Calculator calculator=new Calculator();
     int QuantyChe;
     int QuantyCur;
     int QuantyGen;
     int QuantyWen;
     int QuantyWhi;
     /**
     * Creates new form Purchase
     */
    public Purchase() {
        
        initComponents();
        initialization();
    }
    
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        ConsultButton = new javax.swing.JButton();
        PanelP = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        CherrySlider = new javax.swing.JSlider();
        jLabel3 = new javax.swing.JLabel();
        CurlySlider = new javax.swing.JSlider();
        jLabel4 = new javax.swing.JLabel();
        GenuineSlider = new javax.swing.JSlider();
        jLabel5 = new javax.swing.JLabel();
        WengeSlider = new javax.swing.JSlider();
        jLabel6 = new javax.swing.JLabel();
        WhiteSlider = new javax.swing.JSlider();
        QuantyCherry = new javax.swing.JLabel();
        QuantyCurly = new javax.swing.JLabel();
        QuantyGenuine = new javax.swing.JLabel();
        QuantyWenge = new javax.swing.JLabel();
        QuantyWhite = new javax.swing.JLabel();
        BuyButton = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        LastNameJFTF = new javax.swing.JFormattedTextField();
        AdreessJFTF = new javax.swing.JFormattedTextField();
        NameLabel = new javax.swing.JLabel();
        AdreessLabel = new javax.swing.JLabel();
        NameJFTF = new javax.swing.JFormattedTextField();
        LastLabel = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        TempoLabel = new javax.swing.JLabel();
        PriceDisplay = new javax.swing.JLabel();
        PriceLabel = new javax.swing.JLabel();
        TempoDisplay = new javax.swing.JLabel();
        SalirButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("ORDEN DE COMPRA");

        ConsultButton.setText("CONSULTAR");
        ConsultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ConsultButtonActionPerformed(evt);
            }
        });

        jLabel2.setText("CHERRY");

        CherrySlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                CherrySliderStateChanged(evt);
            }
        });

        jLabel3.setText("CURLY MAPLE");

        CurlySlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                CurlySliderStateChanged(evt);
            }
        });

        jLabel4.setText("GENUINE MAHOGANY");

        GenuineSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                GenuineSliderStateChanged(evt);
            }
        });

        jLabel5.setText("WENGE");

        WengeSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                WengeSliderStateChanged(evt);
            }
        });

        jLabel6.setText("WHITE OAK");

        WhiteSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                WhiteSliderStateChanged(evt);
            }
        });

        javax.swing.GroupLayout PanelPLayout = new javax.swing.GroupLayout(PanelP);
        PanelP.setLayout(PanelPLayout);
        PanelPLayout.setHorizontalGroup(
            PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelPLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(CherrySlider, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(QuantyCherry, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(CurlySlider, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(QuantyCurly, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(WengeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(QuantyWenge, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addGroup(PanelPLayout.createSequentialGroup()
                                .addComponent(GenuineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(QuantyGenuine, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(PanelPLayout.createSequentialGroup()
                                .addComponent(WhiteSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(QuantyWhite, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        PanelPLayout.setVerticalGroup(
            PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PanelPLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(CherrySlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(QuantyCherry, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(CurlySlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4))
                    .addComponent(QuantyCurly, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(GenuineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5))
                    .addComponent(QuantyGenuine, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(PanelPLayout.createSequentialGroup()
                        .addComponent(WengeSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel6))
                    .addComponent(QuantyWenge, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(PanelPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(QuantyWhite, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(WhiteSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        BuyButton.setText("HACER LA COMPRA");
        BuyButton.setEnabled(false);
        BuyButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BuyButtonActionPerformed(evt);
            }
        });

        NameLabel.setText("Nombre:");

        AdreessLabel.setText("Dirección de entrega:");

        LastLabel.setText("Apellido:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(AdreessJFTF)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(AdreessLabel)
                                .addGap(21, 21, 21))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(LastLabel)
                                .addGap(58, 58, 58))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(NameLabel)
                        .addGap(56, 56, 56))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(LastNameJFTF, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
                            .addComponent(NameJFTF, javax.swing.GroupLayout.Alignment.TRAILING))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(NameLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(NameJFTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(LastLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(LastNameJFTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(AdreessLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(AdreessJFTF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(29, 29, 29)
                                .addComponent(PriceLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(TempoDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(PriceDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(37, 37, 37)
                        .addComponent(TempoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(PriceLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(PriceDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(TempoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(TempoDisplay, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(42, Short.MAX_VALUE))
        );

        SalirButton.setText("SALIR");
        SalirButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SalirButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(152, 152, 152)
                .addComponent(jLabel1)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addComponent(PanelP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addComponent(ConsultButton)
                        .addGap(150, 150, 150)
                        .addComponent(BuyButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(58, 58, 58))
                    .addGroup(layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(SalirButton)
                .addGap(80, 80, 80))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel1)
                        .addGap(46, 46, 46)
                        .addComponent(PanelP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(58, 58, 58)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ConsultButton)
                            .addComponent(BuyButton))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(30, 30, 30)
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGap(38, 38, 38)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                .addComponent(SalirButton)
                .addGap(29, 29, 29))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CherrySliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_CherrySliderStateChanged
        JSlider source=(JSlider) evt.getSource();
        QuantyCherry.setText(""+(int)source.getValue()+" Pies");
        QuantyChe=(int)source.getValue();
    }//GEN-LAST:event_CherrySliderStateChanged

    private void CurlySliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_CurlySliderStateChanged
        JSlider source=(JSlider) evt.getSource();
        QuantyCurly.setText(""+(int)source.getValue()+" Pies");
        QuantyCur=(int)source.getValue();
    }//GEN-LAST:event_CurlySliderStateChanged

    private void GenuineSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_GenuineSliderStateChanged
        JSlider source=(JSlider) evt.getSource();
        QuantyGenuine.setText(""+(int)source.getValue()+" Pies");
        QuantyGen=(int)source.getValue();
    }//GEN-LAST:event_GenuineSliderStateChanged

    private void WengeSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_WengeSliderStateChanged
        JSlider source=(JSlider) evt.getSource();
        QuantyWenge.setText(""+(int)source.getValue()+" Pies");
        QuantyWen=(int)source.getValue();
    }//GEN-LAST:event_WengeSliderStateChanged

    private void WhiteSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_WhiteSliderStateChanged
        JSlider source=(JSlider) evt.getSource();
        QuantyWhite.setText(""+(int)source.getValue()+" Pies");
        QuantyWhi=(int)source.getValue();
    }//GEN-LAST:event_WhiteSliderStateChanged

    private void ConsultButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ConsultButtonActionPerformed
        
        info[0]=QuantyChe;
        info[1]=QuantyCur;
        info[2]=QuantyGen;
        info[3]=QuantyWen;
        info[4]=QuantyWhi;
        calculator.setInfo(info);
         
        PriceLabel.setText("Precio Total");
        PriceDisplay.setText(""+((double)(int)(calculator.Price()*1000))/1000 + " US.");
        
        TempoLabel.setText("Tiempo de Entrega");
        TempoDisplay.setText(""+calculator.ShippingTime()+"  Horas.");
        
        this.BuyButton.setEnabled(true);
    }//GEN-LAST:event_ConsultButtonActionPerformed

    private void BuyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BuyButtonActionPerformed
        
        CherrySlider.setEnabled(false); 
        CurlySlider.setEnabled(false);
        GenuineSlider.setEnabled(false);
        WengeSlider.setEnabled(false);
        WhiteSlider.setEnabled(false);
        if(!NameJFTF.isVisible()){
         NameJFTF.setVisible(true);
         NameLabel.setVisible(true);
         LastLabel.setVisible(true);
         LastNameJFTF.setVisible(true);
         AdreessJFTF.setVisible(true);
         AdreessLabel.setVisible(true);
         BuyButton.setText("CONFIRMAR");
        }else{
             if(NameJFTF.getText().equals("")||LastNameJFTF.getText().equals("")||AdreessJFTF.equals("")){
                JOptionPane.showMessageDialog(null, "Tienes que llenar todos los datos", "ADVERTENCIA", JOptionPane.INFORMATION_MESSAGE);
             }
         information=calculator.pricesper();  
            System.out.println("==========================================================");  
            System.out.println("=============       ORDEN FINAL         ==================");
            System.out.println("==========================================================");
            System.out.println(" Tipo ========= Cantidad(pies) ============= Precio ======");
            System.out.println("= " +information[0][0] +" ========= "+information[0][1]+" ============= " +information[0][2]+  " =========");
            System.out.println("==========================================================");
            System.out.println("= " +information[1][0] +" ========= "+information[1][1]+" ============= " +information[1][2]+  " =========");
            System.out.println("==========================================================");
            System.out.println("= " +information[2][0] +" ========= "+information[2][1]+" ============= " +information[2][2]+  " =========");
            System.out.println("==========================================================");
            System.out.println("= " +information[3][0] +" ========= "+information[3][1]+" ============= " +information[3][2]+  " =========");
            System.out.println("==========================================================");
            System.out.println("= " +information[4][0] +" ========= "+information[4][1]+" ============= " +information[4][2]+  " =========");
            System.out.println("==========================================================");
            System.out.println("===============================================");
            System.out.println("Nombre: " + NameJFTF.getText()+" "+LastNameJFTF.getText()+ " Dirección:" + AdreessJFTF.getText());
            
            
        }  
    }//GEN-LAST:event_BuyButtonActionPerformed

    private void SalirButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SalirButtonActionPerformed
      System.exit(0);
    }//GEN-LAST:event_SalirButtonActionPerformed
   
    /**
     * @param args the command line arguments
     * 
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Purchase.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Purchase().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFormattedTextField AdreessJFTF;
    private javax.swing.JLabel AdreessLabel;
    private javax.swing.JButton BuyButton;
    private javax.swing.JSlider CherrySlider;
    private javax.swing.JButton ConsultButton;
    private javax.swing.JSlider CurlySlider;
    private javax.swing.JSlider GenuineSlider;
    private javax.swing.JLabel LastLabel;
    private javax.swing.JFormattedTextField LastNameJFTF;
    private javax.swing.JFormattedTextField NameJFTF;
    private javax.swing.JLabel NameLabel;
    private javax.swing.JPanel PanelP;
    private javax.swing.JLabel PriceDisplay;
    private javax.swing.JLabel PriceLabel;
    private javax.swing.JLabel QuantyCherry;
    private javax.swing.JLabel QuantyCurly;
    private javax.swing.JLabel QuantyGenuine;
    private javax.swing.JLabel QuantyWenge;
    private javax.swing.JLabel QuantyWhite;
    private javax.swing.JButton SalirButton;
    private javax.swing.JLabel TempoDisplay;
    private javax.swing.JLabel TempoLabel;
    private javax.swing.JSlider WengeSlider;
    private javax.swing.JSlider WhiteSlider;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    // End of variables declaration//GEN-END:variables

    private void initialization() {
         this.setTitle("CONSULTA Y VENTA");
         this.setBounds(100, 100, 900, 600);
         NameJFTF.setVisible(false);
         NameLabel.setVisible(false);
         LastLabel.setVisible(false);
         LastNameJFTF.setVisible(false);
         AdreessJFTF.setVisible(false);
         AdreessLabel.setVisible(false);
         CherrySlider.setMaximum(500);
         CherrySlider.setMinimum(0);
         CherrySlider.setMajorTickSpacing(50);
         CherrySlider.setMinorTickSpacing(10);
         CherrySlider.setValue(0);
         CherrySlider.setPaintTicks(true);
         CherrySlider.setPaintLabels(true);
         
         CurlySlider.setMaximum(500);
         CurlySlider.setMinimum(0);
         CurlySlider.setMajorTickSpacing(50);
         CurlySlider.setMinorTickSpacing(10);
         CurlySlider.setValue(0);
         CurlySlider.setPaintTicks(true);
         CurlySlider.setPaintLabels(true);
         
         GenuineSlider.setMaximum(500);
         GenuineSlider.setMinimum(0);
         GenuineSlider.setMajorTickSpacing(50);
         GenuineSlider.setMinorTickSpacing(10);
         GenuineSlider.setValue(0);
         GenuineSlider.setPaintTicks(true);
         GenuineSlider.setPaintLabels(true);
         
         WhiteSlider.setMaximum(500);
         WhiteSlider.setMinimum(0);
         WhiteSlider.setMajorTickSpacing(50);
         WhiteSlider.setMinorTickSpacing(10);
         WhiteSlider.setValue(0);
         WhiteSlider.setPaintTicks(true);
         WhiteSlider.setPaintLabels(true);
         
         WengeSlider.setMaximum(500);
         WengeSlider.setMinimum(0);
         WengeSlider.setMajorTickSpacing(50);
         WengeSlider.setMinorTickSpacing(10);
         WengeSlider.setValue(0);
         WengeSlider.setPaintTicks(true);
         WengeSlider.setPaintLabels(true);
    }
}
